home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Information / Digests / CSMP Digest / volume 3 / csmp-digest-v3-041 / doubleCR.1 < prev   
Encoding:
Text File  |  1995-12-31  |  65.0 KB  |  1,807 lines

  1. C.S.M.P. Digest             Sat, 02 Jul 94       Volume 3 : Issue 41
  2.  
  3. Today's Topics:
  4.  
  5.         Detecting pre-68020 CPU for 68020 code
  6.         Fast Animations (WAS: Fast full screen scrolling: impossible?)
  7.         FlattenMovieData bug???
  8.         Here's how to get OpenDoc
  9.         How to know the cursor is into a polygon?
  10.         PowerPC load-store (was Re: Fast full screen scrolling: impossible?)
  11.         Q: Default button & Return key in Modeless Dialog
  12.         Questions about Tmon?
  13.         Saving PICT files - Here's CODE!!
  14.         Scroll Bars in DLOG?
  15.         Why should't you move baseAddrs?
  16.         cntl-opt-esc
  17.         scroll bars in modal dialogs
  18.  
  19.  
  20.  
  21. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  22. (pottier@clipper.ens.fr).
  23.  
  24. The digest is a collection of article threads from the internet newsgroup
  25. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  26. regularly and want an archive of the discussions.  If you don't know what a
  27. newsgroup is, you probably don't have access to it.  Ask your systems
  28. administrator(s) for details.  If you don't have access to news, you may
  29. still be able to post messages to the group by using a mail server like
  30. anon.penet.fi (mail help@anon.penet.fi for more information).
  31.  
  32. Each issue of the digest contains one or more sets of articles (called
  33. threads), with each set corresponding to a 'discussion' of a particular
  34. subject.  The articles are not edited; all articles included in this digest
  35. are in their original posted form (as received by our news server at
  36. nef.ens.fr).  Article threads are not added to the digest until the last
  37. article added to the thread is at least two weeks old (this is to ensure that
  38. the thread is dead before adding it to the digest).  Article threads that
  39. consist of only one message are generally not included in the digest.
  40.  
  41. The digest is officially distributed by two means, by email and ftp.
  42.  
  43. If you want to receive the digest by mail, send email to listserv@ens.fr
  44. with no subject and one of the following commands as body:
  45.     help                        Sends you a summary of commands
  46.     subscribe csmp-digest Your Name    Adds you to the mailing list
  47.     signoff csmp-digest            Removes you from the list
  48. Once you have subscribed, you will automatically receive each new
  49. issue as it is created.
  50.  
  51. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  52. Questions related to the ftp site should be directed to
  53. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  54. digest are available there.
  55.  
  56. Also, the digests are available to WAIS users.  To search back issues
  57. with WAIS, use comp.sys.mac.programmer.src. With Mosaic, use
  58. http://www.wais.com/wais-dbs/comp.sys.mac.programmer.html.
  59.  
  60.  
  61. -------------------------------------------------------
  62.  
  63. >From nagle@netcom.com (John Nagle)
  64. Subject: Detecting pre-68020 CPU for 68020 code
  65. Date: Thu, 16 Jun 1994 16:44:14 GMT
  66. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  67.  
  68.        Now that Symantec C++ is finally generating 68020 code when asked to
  69. do so (for years, that switch did nothing), it's worth nothing that this
  70. creates a problem in C++.
  71.  
  72.        In C programs, even Think C type programs, the first code executed
  73. is in "main", so it's sufficient to check CPU type there.  But in C++,
  74. static constructors run before "main".  Now that TCL is starting to use
  75. constructors, and constructors are starting to work right in SC++, it's
  76. more likely that code with a 68020 instruction might be executed before
  77. "main".
  78.  
  79.        It's hard to deal with this in a way that's guaranteed to work
  80. from the user program.  The check for 68020 needs to be made in
  81. "CODE 1", the startup code block cranked out by the compiler for every
  82. C++ program.  The user can't do this; only Symantec can.
  83.  
  84.        Anybody still care about pre-68020 machines, anyway?
  85.  
  86.                         John Nagle
  87.  
  88. +++++++++++++++++++++++++++
  89.  
  90. >From jwbaxter@olympus.net (John W. Baxter)
  91. Date: Thu, 16 Jun 1994 19:10:32 -0700
  92. Organization: Internet for the Olympic Peninsula
  93.  
  94. In article <nagleCrI15q.Kru@netcom.com>, nagle@netcom.com (John Nagle)
  95. wrote:
  96.  
  97. >        Anybody still care about pre-68020 machines, anyway?
  98.  
  99. I don't, and I have two of them (a Plus, and a first 100-days Mac now in
  100. 512KE form).
  101.  
  102. However, there still are some Mac Portable owners around who do.  By now,
  103. they must be used to programs which claim to require a 68020 or better
  104. crashing on their machine, but it certainly isn't a nice thing to do to
  105. them.
  106.  
  107. Do the constructors for the static objects actually *use* any 68020
  108. instructions on a regular basis?  [Gestalt is available if you really want
  109. to check in each such constructor...or in a phoney or real object you
  110. arrange to have constructed first.]
  111. -- 
  112. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  113.    No hablo Intel.
  114.    jwbaxter@pt.olympus.net
  115.  
  116. +++++++++++++++++++++++++++
  117.  
  118. >From nagle@netcom.com (John Nagle)
  119. Date: Fri, 17 Jun 1994 15:39:19 GMT
  120. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  121.  
  122. jwbaxter@olympus.net (John W. Baxter) writes:
  123. >Do the constructors for the static objects actually *use* any 68020
  124. >instructions on a regular basis?  [Gestalt is available if you really want
  125. >to check in each such constructor...or in a phoney or real object you
  126. >arrange to have constructed first.]
  127.  
  128.       If you do any subscript calculations involving 2D arrays or arrays
  129. of structures, you'll probably use the 32-bit multiply on a 68020.  
  130. On 68000 machines, a subroutine is called for every 32-bit multiply.
  131.  
  132.       You can't have an object you "arrange to have constructed first".
  133. It's a feature of C++ that order of static constructor execution is
  134. random across file boundaries.  ARM 12.6.1.
  135.  
  136.       You can't even call Gestalt from the constructor usefully unless
  137. your class is a base class.  Base class constructors get called first,
  138. so if your class is derived from another class, its constructor will be
  139. called only after the base class constructor has already run.  It
  140. won't help to override functions in the base class, either; the base class
  141. versions will be called when the base class constructor is called.
  142.  
  143.       So there really isn't a sound way to do this.
  144.  
  145.                     John Nagle
  146.  
  147.  
  148.                     John Nagle
  149.  
  150. ---------------------------
  151.  
  152. >From cfranz@home.malg.imp.com (Christian Franz)
  153. Subject: Fast Animations (WAS: Fast full screen scrolling: impossible?)
  154. Date: Thu, 16 Jun 1994 09:14:27 GMT
  155. Organization: Union Bank of Switzerland, CH
  156.  
  157. In article <1994Jun13.212936.24879@dal1>, seanmcd@ac.dal.ca wrote:
  158. > In article <CrCFxp.79K@park.uvsc.edu>, stay@park.uvsc.edu (Steve Taylor) writes:
  159. > > From article <1994Jun12.232257.24853@dal1>, by seanmcd@ac.dal.ca:
  160. > >> I think Chuck Yeager's Air Combat does this too. You can see interlacing
  161. > >> in the terrain if you rock the plane back and forth.
  162. > >> 
  163. > >> Sean
  164. > > 
  165. > > Could someone describe this technique in more detail?  Are you talking
  166. > > about leaving the other lines there and blitting the other half or
  167. > > are you talking about doubling the height of the lines or what?
  168. > > Thanks.
  169. > > 
  170. > Well the description given above makes AstroChase 3D sound like CYAC,
  171. > although the only thing I've seen in AstroChase 3D is the venetian blind
  172. > style, rendering the frame onto every other line. Deliverance also has the
  173. > option to do this, as does a game called Gate. It looks to me like CYAC
  174. > does interlacing, i.e., there are no black lines alternating with the
  175. > graphics, but if you rock the plane
  176. > or turn rapidly, you can see the interlacing effect fairly easy in large
  177. > polygons. 
  178.  
  179. I'm currently developing a 3D space game and of course, I have the same
  180. problems. I have tried many things, among them the alternate line modes
  181. used by Astrochase (draw every other line) and CYAC (draw even lines on
  182. even frames, odd lines on odd frames). 
  183.  
  184. All these algorithms make one main assumption: 
  185. You draw the image in an off-screen buffer and after you are done drawing
  186. it, you blast the image to screen. It usually takes three steps:
  187.  
  188.   1. erase offscreen buffer
  189.   2. draw new frame offscreen
  190.   3. blast offscreen image on-screen.
  191.  
  192. Tuning step 3 can speed up your program, but usually only by 1/6 max 
  193. (optimized blitting is usually one third of the time per frame and I
  194. assume you double the speed of blitting by halving the lines to copy).
  195.  
  196. I have found out that there is a much better method (however, I doubt 
  197. if this technique can be applied to moving backgrounds as is the
  198. main title of this thread). Actually I didn't find out myself but
  199. Juri Munkki, Mac Animations Guru DeLuxe, did. Since my program uses
  200. polygon-oriented graphics, you collect all your polygons as if you 
  201. would draw them. Then you compare them with all polygons drawn in
  202. the last frame and output *the*difference* to screen. This eliminates
  203. the need to erase your offscreen map and since two successive frames 
  204. are usually similar to each other, you just draw a fraction of what
  205. you usually do. Although the overhead for collecting the polygons
  206. is probably a bit more than drawing them, the subsequent elimination 
  207. of 90% that needs to be redrawn makes up for this. Also, if you just
  208. output the difference, this eliminates the need to as this is included 
  209. into the algorithm. 
  210.  
  211. Mhhh. On second thought, this doesn't work at all for a scrolling 
  212. background... But then, neither CYAC nor AC3D have moving background.
  213.  
  214. > I don't know enough about 3D graphics to know whether you could
  215. > actually render even/odd scanlines or whether he's just splitting an 
  216. > off-screen drawing into two blits.
  217.  
  218. Well, I have some experience with 3D graphics and there are to 
  219. fundamental different approaches. On is called object-space, the
  220. other scan-space (well, at least in german. They seem to translate
  221. badly). In object space you calculate all surfaces of the objects 
  222. and project them on your (off)screen using normal projection methods.
  223. To tune your animation you use object coherencies (you take 
  224. advantage of the fact that an object doesn't change much between
  225. two frames). In this algorithm you can't render only for odd lines.
  226. You have to render the whole scene and then transfer every other
  227. line.
  228.  
  229. In scan space you take the inverted approach. For each pixel you
  230. decide which surface is frontmost and set this pixel to the 
  231. appropriate color/texture. To tune this algorithm you can use
  232. scan-line coherencies (the fact that two pixels in any direction
  233. usually don't change much in color, both in x and y direction).
  234. With scan-space, you *can* render every other line directly.
  235.  
  236. The third possibility is a combination of both methods. It's what
  237. Juri's program does (as I suspect. I havn't seen a single line of
  238. his code, but the performance of the demos he sent me leave no
  239. other explanation). You use object space to pre-calculate all
  240. objects (i.e. all vertices that define your surfaces), collect
  241. them to polygons that are not drawn but *mathematically* compared
  242. to the last frame, collect the difference to other polygons and
  243. finally draw the new polygons (using scan coherencies). You
  244. can draw directly to screen since you change so few things that
  245. it seems instantaneous. Juri claims that his algorithm is a
  246. bit faster than the one used in FA-18 (I think they use
  247. a similar approach) and quite frankly, I believe every word
  248. of it.
  249.  
  250. > Sean
  251.  
  252. OK, sorry to have held you up with this rather lengthy discussion
  253. of some arcane and irrelevant topic, but I have spent a lot of
  254. time investigating this and maybe someone can make some use out
  255. of it. Have a nice day.
  256.  
  257.  
  258. Cheers,
  259. Christian
  260.  
  261. - -
  262. Christian Franz                    *       Union Bank of Switzerland, CH
  263. cfranz@home.malg.imp.com     <- at home ->               +41-1-261 26 96
  264.  
  265. ---------------------------
  266.  
  267. >From Frank Manshande <frankm@and.nl>
  268. Subject: FlattenMovieData bug???
  269. Date: Mon, 13 Jun 1994 14:47:53 GMT
  270. Organization: AND Software BV
  271.  
  272. Hi,
  273.  
  274. According to the Q/A in Develop 16 (page 130)...
  275.  
  276. "Since FlattenMovieData" will simply append to a data fork of
  277. a file, you can pass it any data file and it will append the
  278. movie data to that file. Quicktime doesn't care what's stored
  279. before or after the movie data, as long as you don't reposition
  280. the movie data within the data dile."
  281.  
  282. Well, if I try this, and append a movie using FlattenMovieData",
  283. the first 8 bytes will be overwritten with 4 bytes and then 'mdat'.
  284.  
  285. Even if I pass the flag 'flattenAddMovieToDataFork' !
  286.  
  287. It seems like this is a bug! I don't want that data stored before
  288. the movie overwritten. My solution now is to read the first 8
  289. bytes, then FlattenMovieData one or more quicktimes movie files
  290. and then restore the first 8 bytes. But I am not certain that
  291. replacing those 8 bytes won't have any side effects. What I do
  292. is store the "Movie" structure, using PutMovieIntoDataFork at
  293. a specific offset.
  294.  
  295. My datafile looks like this:
  296.  
  297. - -------------------------------
  298. | some data (other than movies) |
  299. - -------------------------------
  300. | flattened movie               |
  301. - -------------------------------
  302. | "Movie" structure             |
  303. - -------------------------------
  304. | flattened movie               |
  305. - -------------------------------
  306. | "Movie" structure             |
  307. - -------------------------------
  308. | flattened movie               |
  309. - -------------------------------
  310. | "Movie" structure             |
  311. - -------------------------------
  312.  
  313. This works. But the first 8 bytes are overwritten in "some data".
  314.  
  315. Any info would be very much appreciated!
  316.  
  317. Frank Manshande
  318. frankm@and.nl
  319.  
  320. +++++++++++++++++++++++++++
  321.  
  322. >From ivanski@world.std.com (Ivan M CaveroBelaunde)
  323. Date: Mon, 13 Jun 1994 18:05:25 GMT
  324. Organization: The World Public Access UNIX, Brookline, MA
  325.  
  326. Frank Manshande <frankm@and.nl> writes:
  327.  
  328. >This works. But the first 8 bytes are overwritten in "some data".
  329.  
  330. What happens is that QT stores the info in a Bento-like atomic form. The
  331. single-fork movie (flattened means "self-contained", not "single-fork").
  332. must contain "atoms" in order for QT to properly navigate it. Atoms are
  333. structured as follows:
  334.  
  335.     {
  336.         long    atomSize;    //    includes atomSize+atomType
  337.         OSType    atomType;
  338.         ... atom specific data ...
  339.     }
  340.  
  341. So for your multimovie file to work it needs to contain atom headers
  342. before each movie data atom of the right size. It also needs an 
  343. atom header in front of your data to allow QT to traverse the movie.
  344. This isn't a bug AFAIK; it seems Develop 16 was wrong in the general
  345. case (you can't just append the movie data for single fork files). If
  346. you control the file format, however, and you can add the atom header
  347. yourself, then it is feasible to do what they say. Given this structure,
  348. however, I'd avoid "restoring" the first 8 bytes as you were doing,
  349. since it's bound to affect your ability to access the multiple movies...
  350.  
  351. Additionally, you might want to check out John Wang's article
  352. in Develop 17 ("Somewhere in QuickTime"), since I seem to remember
  353. there is a bug in FlattenMovieData in which the size field is not
  354. properly set when using multiple movies, and a fix (BetterFlattenMovieData)
  355. is discussed in it.
  356.  
  357. Hope this helps,
  358.  
  359. -Ivan
  360. - -
  361. Ivan Cavero Belaunde (ivanski@world.std.com)
  362. Avid VideoShop Project Lead
  363. Avid Technology, Inc.
  364.  
  365. +++++++++++++++++++++++++++
  366.  
  367. >From Frank Manshande <frankm@and.nl>
  368. Date: Tue, 14 Jun 1994 06:51:11 GMT
  369. Organization: AND Software BV
  370.  
  371. In article <CrCKx2.952@world.std.com> Ivan M CaveroBelaunde,
  372. ivanski@world.std.com writes:
  373. >If you control the file format, however, and you can add the atom header
  374. >yourself, then it is feasible to do what they say. Given this structure,
  375. >however, I'd avoid "restoring" the first 8 bytes as you were doing,
  376. >since it's bound to affect your ability to access the multiple movies...
  377.  
  378. Well,
  379.  
  380. First of all thanks for your time!
  381.  
  382. I have written two small programs. One that adds a movie to ANY kind
  383. of file, and displays the offset of the 'movie resource' using the
  384. PutMovieIntoDataFork call. And another program that can play the movies
  385. at the specified offsets. This does seem to work correctly.
  386.  
  387. The only side-effect I have encountered so far is that the file which
  388. I added the movies to cannot be played by SimplePlayer. SimplePlayer
  389. can play the first movie if I don't save and restore the first 8 bytes
  390. of the file. But because I don't want to play the movies using a
  391. general movie player, but only from my own program, this should not
  392. be a problem.
  393.  
  394. The reason I have to restore the first 8 bytes of the file is that
  395. the quicktime movies are added to a specific database file (the database
  396. file is of proprietary format), and the database engine doesn't work
  397. if the first 8 bytes are overwritten.
  398.  
  399. The reason why I don't just create two seperate files (one with the
  400. database and one with all the quicktime movies) is that our customers
  401. (and our company) only wants ONE file, which contains all the data.
  402.  
  403. Does anybody know if saving and restoring the first 8 bytes that
  404. FlattenMovieData overwrites has any other side effects then not
  405. allowing programs such as SimplePlayer to play a movie?
  406.  
  407. Thanks!
  408.  
  409. Frank Manshande
  410. frankm@and.nl
  411.  
  412. +++++++++++++++++++++++++++
  413.  
  414. >From Peter Vanags <peterv@uclink.berkeley.edu>
  415. Date: 15 Jun 1994 20:43:47 GMT
  416. Organization: UCB
  417.  
  418. In article <CrDKDC.30H@and.nl> Frank Manshande, frankm@and.nl writes:
  419. >Does anybody know if saving and restoring the first 8 bytes that
  420. >FlattenMovieData overwrites has any other side effects then not
  421. >allowing programs such as SimplePlayer to play a movie?
  422.  
  423. Nope, not a problem. The only caveat is you MUST use
  424. NewMoveFromDataFork() with the offset to the 'mdat' or 'moov' atom to
  425. retrieve the movie, if the other data in the data fork is not stored in
  426. "atom" form. 
  427.  
  428. To be clean about using FlattenMovieData(), you should use the following
  429. procedure:
  430.  
  431. - store the first 8 bytes of the data fork
  432. - store the file's length
  433. - append a dummy 'mdat' atom to the end of the data fork
  434. - call FlattenMovieData()
  435. - check the offset to the end of the movie data, which is now 
  436.   in the first 4 bytes of the data fork, compare to the length
  437.   before FlattenMovieData() was called
  438.   and update your dummy atom
  439. - restore the first 8 bytes of the file's data fork
  440.  
  441. I talked with John Wang at MacDTS (author of the "Somewhere in QuickTime"
  442. column in develop) quite a bit about this issue right before he published
  443. the article.
  444.  
  445.  
  446. Peter Vanags
  447. peterv@uclink.berkeley.edu
  448.  
  449. +++++++++++++++++++++++++++
  450.  
  451. >From jywang@apple.com (John Wang)
  452. Date: 16 Jun 1994 00:27:12 GMT
  453. Organization: Apple Computer, Inc.
  454.  
  455. FYI.  The bug fix for the problem described in issue #17 of my article has
  456. been added to QuickTime 2.0.  If you use my BetterFlattenMovie or
  457. BetterFlattenMovieData routine, you will be all set since
  458. BetterFlattenMovie only patches FlattenMovie when QuickTime 1.6.X or
  459. earlier is used.
  460.  
  461. John
  462.  
  463. ---------------------------
  464.  
  465. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  466. Subject: Here's how to get OpenDoc
  467. Date: Wed, 15 Jun 1994 23:30:31 GMT
  468. Organization: Apple Computer
  469.  
  470. I just got off the phone with our evangelist, Mark "Rev. Billy-Bob" Thomas,
  471. to get the true facts about OpenDoc seeding. Here's the scoop.
  472.  
  473. * The current (a6) version of OpenDoc is _not_ going to be distributed more
  474. widely than to the WWDC attendees. They decided against a blanket mailing to
  475. all registered developers because, as Mark put it, "You only get one chance
  476. to make a good first impression". The a6 build is still a bit flaky, requires
  477. MPW, and doesn't come with much in the way of documentation. Their fear was
  478. that, if everybody got it, many would play with it a little, run into
  479. problems, and not look at it again later when things are more polished.
  480.  
  481. * The beta seed _is_ going to be distributed widely. It'll be on the
  482. developer CD. It'll be on the 'develop' bookmark CD, and we're hoping to get
  483. a number of OpenDoc articles in that issue of 'develop'. (Note that anyone
  484. can order single issues of 'develop' from APDA for $10.) This will probably
  485. be in September given the lead time involved in pressing CDs. By that time
  486. the code will be more stable, you'll be able to build with CodeWarrior (hope
  487. hope hope), and there will be at least draft versions of the official
  488. documentation for both OpenDoc and the framework.
  489.  
  490. * But! If you're interested in getting started with OpenDoc _now_ (and how
  491. can I blame you?) you can send mail to OpenDoc@applelink.apple.com and get a
  492. CD with version a6 in return for filling out a short form.
  493.  
  494. * Feel free to post OpenDoc questions here; I'll try to answer them. There is
  495. an OpenDoc mailing list; send mail to <majordomo@cil.org> with body
  496. "subscribe opendoc-interest" to subscribe. There is also a discussion board
  497. on AppleLink somewhere.
  498.  
  499. I hope this answers your questions. Sorry about any misinformation I've
  500. posted in the past ...
  501.  
  502. --Jens Alfke
  503.   jens_alfke@powertalk              Rebel girl, rebel girl,
  504.             .apple.com              Rebel girl you are the queen of my world
  505.  
  506. +++++++++++++++++++++++++++
  507.  
  508. >From chuck@molecule.Physics.Drexel.Edu (Chuck Browne)
  509. Date: Thu, 16 Jun 1994 16:35:00 GMT
  510. Organization: Drexel University
  511.  
  512. Jens Alfke (jens_alfke@powertalk.apple.com) wrote:
  513. : I just got off the phone with our evangelist, Mark "Rev. Billy-Bob" Thomas,
  514. : to get the true facts about OpenDoc seeding. Here's the scoop.
  515.  
  516. : * The beta seed _is_ going to be distributed widely. It'll be on the
  517. : developer CD. It'll be on the 'develop' bookmark CD, and we're hoping to get
  518.  
  519. Thanks, Jens
  520.  
  521. Is there any problem with lending it to Metrowerks for shipping on the
  522. DR4 CD, which roughly comes out at the same time? 
  523. (Not that I'm trying to save a couple of bucks or anything... :-) )
  524.  
  525. Chuck
  526.  
  527.  
  528.  
  529. +++++++++++++++++++++++++++
  530.  
  531. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  532. Date: Thu, 16 Jun 1994 22:55:44 GMT
  533. Organization: Apple Computer
  534.  
  535. Chuck Browne, chuck@molecule.Physics.Drexel.Edu writes:
  536. > Is there any problem with lending it to Metrowerks for shipping on the
  537. > DR4 CD, which roughly comes out at the same time? 
  538.  
  539. I think Mark wants people to go directly to Apple to obtain it. He wants to
  540. keep tabs on how many people have it and who they are (in case we need to
  541. send out any mass mailings, or sell your names and addresses to The Sharper
  542. Image :)
  543.  
  544. > (Not that I'm trying to save a couple of bucks or anything... :-) )
  545.  
  546. I don't think we're charging anything for the OpenDoc seed.
  547.  
  548. --Jens Alfke
  549.   jens_alfke@powertalk              Rebel girl, rebel girl,
  550.             .apple.com              Rebel girl you are the queen of my world
  551.  
  552. +++++++++++++++++++++++++++
  553.  
  554. >From chuck@molecule.Physics.Drexel.Edu (Chuck Browne)
  555. Date: Fri, 17 Jun 1994 00:58:43 GMT
  556. Organization: Drexel University
  557.  
  558. Jens Alfke (jens_alfke@powertalk.apple.com) wrote:
  559. : Chuck Browne, chuck@molecule.Physics.Drexel.Edu writes:
  560. : > Is there any problem with lending it to Metrowerks for shipping on the
  561. : > DR4 CD, which roughly comes out at the same time? 
  562.  
  563. : I think Mark wants people to go directly to Apple to obtain it. He wants to
  564. : keep tabs on how many people have it and who they are (in case we need to
  565. : send out any mass mailings, or sell your names and addresses to The Sharper
  566. : Image :)
  567.  
  568. : > (Not that I'm trying to save a couple of bucks or anything... :-) )
  569.  
  570. : I don't think we're charging anything for the OpenDoc seed.
  571.  
  572. I meant the $10 for develop, but what you say is good to hear. 
  573. (Not that I need OpenDoc or anything, I'm just curious about it and 
  574. what it will mean to software in the next couple of years...
  575. maybe I'll try it out, if I manage to get my PhD on schedule..)
  576.  
  577. Thanks,
  578. Chuck
  579.  
  580.  
  581. : --Jens Alfke
  582. :   jens_alfke@powertalk              Rebel girl, rebel girl,
  583. :             .apple.com              Rebel girl you are the queen of my world
  584.  
  585. ---------------------------
  586.  
  587. >From belanger@bach.ulaval.ca (Yves Belanger)
  588. Subject: How to know the cursor is into a polygon?
  589. Date: Tue, 14 Jun 1994 18:09:32 GMT
  590. Organization: Universite Laval, Ste-Foy (Quebec), Canada
  591.  
  592. Hello,
  593.  
  594. I am writing an application where districts are drawn on a geographic
  595. map. Districts are made with many points, like a polygon in MacDraw.
  596. Each point is given a longitude and a latitude. I have functions that
  597. translate back and forth these coordinates into screen coordinates.
  598.  
  599. My problem is how to determine that a user has clicked inside one of
  600. those polygon or the click was outside them all? If the solution could
  601. work with longitude and latitude, that would be greater, since less
  602. computing would be involved. Thank you.
  603.  
  604. S. Beaudry
  605.  
  606. +++++++++++++++++++++++++++
  607.  
  608. >From Mark Hanrek <hanrek@cts.com>
  609. Date: Tue, 14 Jun 1994 22:49:07 GMT
  610. Organization: The Information Workshop
  611.  
  612. In article <CrEFrx.LDq@athena.ulaval.ca> Yves Belanger,
  613. belanger@bach.ulaval.ca writes:
  614.  
  615. > I am writing an application where districts are drawn on a geographic
  616. > map. Districts are made with many points, like a polygon in MacDraw.
  617. > Each point is given a longitude and a latitude. I have functions that
  618. > translate back and forth these coordinates into screen coordinates.
  619.  
  620. The most common approach is to take advantage of the Macintosh's built-in
  621. region capabilities. They are incredibly powerful, and very easy to use.
  622.  
  623. You can easily take any polygon and create the equivalent region from it,
  624. which is kept in a RegionHandle.
  625.  
  626. Keep a list of these RegionHandles handy, one for each district, and when
  627. the user clicks, take the location of the click and then in a loop use
  628. the PtInRgn() toolbox call to test whether that point is within each of
  629. the regions.  When the result is true, bingo.
  630.  
  631. If there are overlapping regions, be sure they are set up and tested in
  632. front to back order.
  633.  
  634. That's all there is to it, unless I misunderstood your situation.
  635.  
  636. I forget the exact calls to make a region from a polygon, but the whole
  637. process is exceedingly simple.
  638.  
  639. This is the only approach I know of, really.
  640.  
  641. Mark Hanrek
  642.  
  643. +++++++++++++++++++++++++++
  644.  
  645. >From jwbaxter@olympus.net (John W. Baxter)
  646. Date: Tue, 14 Jun 1994 21:09:23 -0700
  647. Organization: Internet for the Olympic Peninsula
  648.  
  649. In article <CrEFrx.LDq@athena.ulaval.ca>, belanger@bach.ulaval.ca (Yves
  650. Belanger) wrote:
  651.  
  652. > Hello,
  653. > I am writing an application where districts are drawn on a geographic
  654. > map. Districts are made with many points, like a polygon in MacDraw.
  655. > Each point is given a longitude and a latitude. I have functions that
  656. > translate back and forth these coordinates into screen coordinates.
  657. > My problem is how to determine that a user has clicked inside one of
  658. > those polygon or the click was outside them all? If the solution could
  659. > work with longitude and latitude, that would be greater, since less
  660. > computing would be involved. Thank you.
  661.  
  662. My approach would be based on creating a QD region which covers the same
  663. "territory" as the polygon, and using the provided PtInRgn call against the
  664. region.  Only if that were not "fast enough" would I probe further.
  665.  
  666. Or...better...switch to QuickDraw GX, where you're likely to be working
  667. with a polygon shape, and you can easily hit-test that (or any other
  668. shape).  That may put things a little more into the future than you want,
  669. though.
  670. -- 
  671. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  672.    No hablo Intel.
  673.    jwbaxter@pt.olympus.net
  674.  
  675. +++++++++++++++++++++++++++
  676.  
  677. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  678. Date: Wed, 15 Jun 1994 22:21:34 GMT
  679. Organization: Apple Computer
  680.  
  681. In article <CrEFrx.LDq@athena.ulaval.ca> Yves Belanger,
  682. belanger@bach.ulaval.ca writes:
  683. > My problem is how to determine that a user has clicked inside one of
  684. > those polygon or the click was outside them all?
  685.  
  686. As has been said, the easiest solution is to create a region of the same
  687. shape as the polygon, then call PtInRegion. This does have the drawback that
  688. regions containing diagonal lines eat up lots of memory. (Think of the
  689. boundary of the region as a polygon, including little stairsteps at pixel
  690. edges on diagonal lines. The region then occupies about two to four bytes per
  691. vertex of that polygon.) Unfortunately, regions larger than 64kbytes will
  692. crash QuickDraw. This shouldn't be a problem unless your polygons are very
  693. large or complex.
  694.  
  695. To create a region from a polygon:
  696. * Call OpenRgn
  697. * MoveTo the first point in the polygon, LineTo each succeeding point. Make
  698. sure to end with a LineTo back to the first point.
  699. * Call CloseRgn.
  700.  
  701. Your other alternative is to use a real "point in polygon" test. You could
  702. either be the four millionth person this month to ask about this on
  703. comp.graphics.algorithms, or you could get a standard computer graphics
  704. textbook like "Computer Graphics: Principles and Practice" by Foley, Van Dam
  705. et al. There may also be source code available by ftp, but I have no idea
  706. where.
  707.  
  708. --Jens Alfke
  709.   jens_alfke@powertalk              Rebel girl, rebel girl,
  710.             .apple.com              Rebel girl you are the queen of my world
  711.  
  712. +++++++++++++++++++++++++++
  713.  
  714. >From mxmora@unix.sri.com (Matt Mora)
  715. Date: 16 Jun 1994 09:28:11 -0700
  716. Organization: SRI International, Menlo Park, CA
  717.  
  718. In article <1994Jun15.222134.21946@gallant.apple.com> Jens Alfke <jens_alfke@powertalk.apple.com> writes:
  719. >In article <CrEFrx.LDq@athena.ulaval.ca> Yves Belanger,
  720. >belanger@bach.ulaval.ca writes:
  721. >> My problem is how to determine that a user has clicked inside one of
  722. >> those polygon or the click was outside them all?
  723. >
  724. >As has been said, the easiest solution is to create a region of the same
  725. >shape as the polygon, then call PtInRegion. This does have the drawback that
  726. >regions containing diagonal lines eat up lots of memory. (Think of the
  727. >boundary of the region as a polygon, including little stairsteps at pixel
  728. >edges on diagonal lines. The region then occupies about two to four bytes per
  729. >vertex of that polygon.) Unfortunately, regions larger than 64kbytes will
  730. >crash QuickDraw. This shouldn't be a problem unless your polygons are very
  731. >large or complex.
  732. >
  733. >To create a region from a polygon:
  734. >* Call OpenRgn
  735. >* MoveTo the first point in the polygon, LineTo each succeeding point. Make
  736. >sure to end with a LineTo back to the first point.
  737. >* Call CloseRgn.
  738. >
  739. >Your other alternative is to use a real "point in polygon" test. You could
  740. >either be the four millionth person this month to ask about this on
  741. >comp.graphics.algorithms, or you could get a standard computer graphics
  742. >textbook like "Computer Graphics: Principles and Practice" by Foley, Van Dam
  743. >et al. There may also be source code available by ftp, but I have no idea
  744. >where.
  745.  
  746.  
  747.  
  748. >From the UMPG Vol II
  749.  
  750. Subject: Re: Point in Polygon routine needed
  751. From: fry@zariski.harvard.edu (David Fry)
  752.  
  753. In article <8fxkxAO00WB7M=nOFO@andrew.cmu.edu> Andrew Lewis Tepper <at15+@andrew.cmu.edu> writes:
  754. >I don't know if this routine is "standard", I just came up with it recently:
  755. >
  756. >For a polygon of points p1...pn, and a point P, make a table as follows:
  757. >
  758. >T(1)= angle from p1 to P to p2
  759. >T(2)= angle from p2 to P to p3
  760. >...
  761. >T(n)= angle from pn to P to p1
  762. >
  763. >express all angles as: -PI < angle < PI.
  764. >
  765. >Add all entries in the table. If the sum = 0, the point is outside. If
  766. >the sum is +/- PI, the point is inside. If the point is +/- xPI, you
  767. >have a strange polygon. If ANY angle was = +/-PI, the point is on the
  768. >border.
  769. >
  770. >Does anyone know if this is considered a good (known?) algorithm? It
  771. >took a long time to come up with!
  772.  
  773. You have the essence of the "good," standard algorithm, but if you're
  774. working with thousands of polygons, those floating point calculations
  775. will be too slow and will probably lead to round-off error at some
  776. point.  Round-off error is a huge pain in computational geometry
  777. problems.  The hard part is finding ways to avoid it.
  778.  
  779. The trick is that you don't need to know the angle between the lines,
  780. you just need to know its sign, called the *circulation*.   For every
  781. line AB in the polygon, form the triangle PAB and you want to know
  782. does it lie inside the polygon or not.  That is, if you were riding a
  783. bike counterclockwise around the boundary of the polygon, would P 
  784. lie on your left or your right when you crossed AB?  You can find this
  785. by calculating PA x PB = (A.x-P.x)*(B.y-P.y) - (A.y-P.y)*(B.x-P.x).
  786. The circulation (the sign of PA x PB) can be found without doing a
  787. multiplication in many cases, but this is good enough.  Remember,
  788. we've oriented the polygon so that you come to A before coming to B as
  789. your traverse its boundary.
  790.  
  791. Then the algorithm is:
  792.  
  793. In = 0
  794. foreach edge AB in the polygon
  795.     if A.y < P.y and B.y >= P.y and PA x PB > 0
  796.         In = In + 1
  797.     if A.y >= P.y and B.y < P.y and PA x PB < 0
  798.         In = In - 1
  799.  
  800. Then if In = 1, P is inside the polygon, and is outside if I = 0. 
  801. This doesn't handle the case where P lies on some edge AB of the
  802. polygon.
  803.  
  804.  
  805. David Fry                                  fry@math.harvard.edu
  806. Division of Applied Sciences               fry@huma1.bitnet
  807. Harvard University                      ...!harvard!huma1!fry
  808. Cambridge, MA  02138            
  809.  
  810.  
  811. - ----------
  812. end of artile
  813.  
  814.  
  815. Xavier
  816.  
  817. -- 
  818. ___________________________________________________________
  819. Matthew Xavier Mora                       Matt_Mora@sri.com
  820. SRI International                       mxmora@unix.sri.com
  821. 333 Ravenswood Ave                    Menlo Park, CA. 94025
  822.  
  823. +++++++++++++++++++++++++++
  824.  
  825. >From Rick Wong <rick@jessica.stanford.edu>
  826. Date: 16 Jun 1994 17:59:54 GMT
  827. Organization: Stanford University
  828.  
  829. In article <CrEFrx.LDq@athena.ulaval.ca> Yves Belanger,
  830. belanger@bach.ulaval.ca writes:
  831. > My problem is how to determine that a user has clicked inside one of
  832. > those polygon or the click was outside them all?
  833.  
  834. One approach is to create an offscreen bitmap with its origin set
  835. up so that the bitmap is centered around the click locaction.  The
  836. bitmap doesn't have to be very big at all, just enough for your hit
  837. tolerance.  For each polygon you want to test, clear the bitmap,
  838. then draw the polygon into it (if you want to see if the point is
  839. inside the polygon, you should draw it with a black fill pattern).
  840. You can then examine the individual bits around the click location
  841. to see if any are set.
  842.  
  843. Of course, such "cleverness" is unnecessary under QuickDraw GX....
  844.  
  845. --Rick Wong
  846.  
  847. ---------------------------
  848.  
  849. >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik)
  850. Subject: PowerPC load-store (was Re: Fast full screen scrolling: impossible?)
  851. Date: 15 Jun 1994 15:23:53 GMT
  852. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  853.  
  854. In article <1994Jun12.182803.1@west.cscwc.pima.edu> 103t_english@west.cscwc.pima.edu writes:
  855.  
  856. > And finally, what happened to the load/store multiple instructions that are
  857. > (I assume?) faster on the 601, but will probably be slower "in future
  858. > implementations?"
  859.  
  860. the load/store multiple instructions are not faster than a series of loads
  861. and stores (except perhaps if there are stalls from the instruction cache).
  862. they take 1 cycle per load or store.
  863.  
  864. these instructions are present to make saving and restoring registers
  865. (GPRs only) to the stack a little bit easier.  that's really the only benefit
  866. to them.
  867.  
  868. many of the PowerPC architects do not like these instructions because they
  869. do not fit the RISC model very well, thus they complicate the processor
  870. implementation.  don't expect IBM/Motorola to invest much time on these
  871. instructions.  witness the lack of equivalent instructions for floating-
  872. point registers or for 64-bit GPRs.
  873.  
  874. these instructions will become slower when they decide to eliminate them
  875. and handle them via trap-and-emulate. (hey, at least they're telling you
  876. all this up front)
  877.  
  878. -gary j kacmarcik
  879. platypus@cirrus.som.cwru.edu
  880.  
  881. +++++++++++++++++++++++++++
  882.  
  883. >From zstern@adobe.com (Zalman Stern)
  884. Date: Wed, 15 Jun 1994 20:34:44 GMT
  885. Organization: Adobe Systems Incorporated
  886.  
  887. Gary Kacmarcik writes
  888. > the load/store multiple instructions are not faster than a series of loads
  889. > and stores (except perhaps if there are stalls from the instruction  
  890. cache).
  891. > they take 1 cycle per load or store.
  892.  
  893. Which will happen relatively often on the 601. (For example anytime you save  
  894. 8 or more registers, its guaranteed to happen.)
  895.  
  896. > these instructions are present to make saving and restoring registers
  897. > (GPRs only) to the stack a little bit easier.  that's really the only  
  898. benefit
  899. > to them.
  900.  
  901. They improve code density somewhat. Given the size of native apps that's a  
  902. concern.
  903.  
  904. > many of the PowerPC architects do not like these instructions because they
  905. > do not fit the RISC model very well, thus they complicate the processor
  906. > implementation.  don't expect IBM/Motorola to invest much time on these
  907. > instructions.  witness the lack of equivalent instructions for floating-
  908. > point registers or for 64-bit GPRs.
  909.  
  910. Bottom line: the architecture would be better without load/store multiple.  
  911. However since the architects could not reach agreement to remove these  
  912. instructions, the implementors should support them. As it stands now, some  
  913. implementors will makes these instructions competitive and some won't.  
  914. Applications developers will be stuck with a choice which way to go. For  
  915. load/store multiple, this doesn't bother me that much. (One might take a  
  916. minor speed hit to win on code space most places anyway.) However the manual  
  917. says similar things about load/store update instructions vs. using a  
  918. load/store and an add instruction. This causes a much bigger performance  
  919. tradeoff right in the middle of your inner loops. A PowerPC implementation  
  920. where the two instruction sequence is faster than an update form instruction  
  921. would be braindead.
  922. --
  923. Zalman Stern           zalman@adobe.com            (415) 962 3824
  924. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  925. `Wait a second! This is just an octahedron suspended in blue liquid.' - JT
  926.  
  927. +++++++++++++++++++++++++++
  928.  
  929. >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik)
  930. Date: 16 Jun 1994 18:34:53 GMT
  931. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  932.  
  933. In article <1994Jun15.203444.3373@adobe.com> zstern@adobe.com (Zalman Stern) writes:
  934. >
  935. > Gary Kacmarcik writes
  936. > > these instructions are present to make saving and restoring registers
  937. > > (GPRs only) to the stack a little bit easier.  that's really the only  
  938. > > benefit to them.
  939. >
  940. > They improve code density somewhat. Given the size of native apps that's a  
  941. > concern.
  942.  
  943. but they don't affect code density all that much.  the recommended way
  944. doing the load/store sequence of instructions is to have a series of
  945. loads (or stores) somewhere in the app or OS like
  946.  
  947.    lwz    r13,0(r0)
  948.    lwz    r14,4(r0)
  949.    ...
  950.    lwz    r31,68(r0)
  951.    bcctr
  952.  
  953. (or something like that - i believe that the standard save/restore glue
  954. does a few other things, but i don't have the exact sequence handy).
  955.  
  956. then a function that wants to save a bunch of registers just calculates 
  957. the address of where the first register should be saved and branches to
  958. appropriate lwz instruction.  you have to do this anyway for floating-
  959. point and 64-bit reg's, so it's not a big deal.
  960.  
  961. the end result is that if it's done this way, it won't have a big impact
  962. on code density.  performance is basically to same too, since the branches
  963. (both of which are unconditional) are "free" and the glue code may
  964. already be in the i-cache (from previous functions).
  965.  
  966. -gary j kacmarcik
  967. platypus@cirrus.som.cwru.edu
  968.  
  969. +++++++++++++++++++++++++++
  970.  
  971. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  972. Date: Fri, 17 Jun 1994 04:23:38 +1200 (NZST)
  973. Organization: (none)
  974.  
  975. platypus@cirrus.som.cwru.edu (Gary Kacmarcik) writes:
  976. > many of the PowerPC architects do not like these instructions because they
  977. > do not fit the RISC model very well, thus they complicate the processor
  978. > implementation.  don't expect IBM/Motorola to invest much time on these
  979. > instructions.  witness the lack of equivalent instructions for floating-
  980. > point registers or for 64-bit GPRs.
  981. > these instructions will become slower when they decide to eliminate them
  982. > and handle them via trap-and-emulate. (hey, at least they're telling you
  983. > all this up front)
  984.  
  985. That won't be too bad -- everyone sees it coming, and coming (fairly) soon,
  986. and if you're saving a number of registers the speed hit won't be *that*
  987. horrible (but horrible enough), and most people don't use it inside of
  988. tight loops, and it's no faster than the alternative anyway.
  989.  
  990. The really, *really* horrible one will come when the "load with update"
  991. and "store with update" instructions get the trap-and-emulate treatment.
  992.  
  993. For the non PPC-savvy folk, those instructions get used to implement
  994. the C constructs *++p and *--p (and *p++ and *p-- with a smart optomising
  995. compiler that can transform your code).
  996.  
  997. They're used a *lot*, they're a big speed win on the 601 (less on the
  998. 603 and 604 if you don't mind tying up two units for a load and an addi
  999. in parallel becasue you've got nothing better to do with them), and they
  1000. occur in speed-critical inner loops.
  1001.  
  1002. -- Bruce
  1003.  
  1004. ---------------------------
  1005.  
  1006. >From efisch@cs.tamu.edu (Eric A Fisch)
  1007. Subject: Q: Default button & Return key in Modeless Dialog
  1008. Date: 16 Jun 1994 18:56:00 GMT
  1009. Organization: Texas A&M Computer Science Department, College Station, TX
  1010.  
  1011. I am working with modeless dialogs and am quite pleased with the
  1012. results. I am having a problem defining a default button and making
  1013. the return (or enter) key activate it. Right now, when the return key
  1014. is pressed it is passed into the active editable text field. I do have
  1015. the OK button at item number 1, but I am clearly missing something. Any
  1016. thoughts?
  1017.  
  1018.  
  1019. Thanks,
  1020. Eric Fisch
  1021. efisch@cs.tamu.edu
  1022.  
  1023. +++++++++++++++++++++++++++
  1024.  
  1025. >From egurney@vcd.hp.com (Eddy J. Gurney)
  1026. Date: Thu, 16 Jun 1994 20:01:29 GMT
  1027. Organization: Hewlett-Packard VCD
  1028.  
  1029. Eric A Fisch (efisch@cs.tamu.edu) wrote:
  1030. >I am working with modeless dialogs and am quite pleased with the
  1031. >results. I am having a problem defining a default button and making
  1032. >the return (or enter) key activate it. Right now, when the return key
  1033. >is pressed it is passed into the active editable text field. I do have
  1034. >the OK button at item number 1, but I am clearly missing something. Any
  1035. >thoughts?
  1036.  
  1037. Yes. After calling IsDialogEvent() from your event loop and determining
  1038. that this is an event for an open modeless dialog, you need to
  1039. "pre-process" the event before passing it on to DialogSelect() and check
  1040. for a "keyDown" or "autoKey" event when theEvent.message & charCodeMask
  1041. is equal to the Enter or Return key and process it appropriately... being
  1042. sure to NOT pass the event on to DialogSelect() afterwards.
  1043.  
  1044. You need to do a similar thing anyway to catch Command-key equivalents,
  1045. which DialogSelect() also just "pushes" through to TEKey...
  1046.  
  1047. --
  1048. Eddy J. Gurney N8FPW   Hewlett-Packard Company, Vancouver (USA!) Division
  1049. egurney@vcd.hp.com                       #include <standard-disclaimer.h>
  1050. "Failures are divided into two classes-- those who thought and never did,
  1051.       and those who did and never thought."     John Charles Salak
  1052.  
  1053. +++++++++++++++++++++++++++
  1054.  
  1055. >From dubois@primate.wisc.edu (Paul DuBois)
  1056. Date: 16 Jun 1994 15:46:39 -0500
  1057. Organization: Castra Parvulorum
  1058.  
  1059. >From article <2tq780$3i8@news.tamu.edu>, by efisch@cs.tamu.edu (Eric A Fisch):
  1060. > I am working with modeless dialogs and am quite pleased with the
  1061. > results. I am having a problem defining a default button and making
  1062. > the return (or enter) key activate it. Right now, when the return key
  1063. > is pressed it is passed into the active editable text field. I do have
  1064. > the OK button at item number 1, but I am clearly missing something. Any
  1065. > thoughts?
  1066.  
  1067. You have to handle it yourself in a modeless dialog.
  1068. -- 
  1069. Paul DuBois
  1070. dubois@primate.wisc.edu
  1071.  
  1072. ---------------------------
  1073.  
  1074. >From apabla@hercules.cs.uregina.ca (jaime apablaza)
  1075. Subject: Questions about Tmon?
  1076. Date: Wed, 01 Jun 1994 03:19:37 GMT
  1077. Organization: University of Regina
  1078.  
  1079. How much does Tmon Pro cost and where can I order it from?  I read in the 
  1080. faq that Tmon has a rather steep learning curve so I was wondering is 
  1081. that because the manual is rather cryptic.  If so are there third party 
  1082. books on using Tmon?  Email preferred.
  1083.  
  1084.  
  1085. +++++++++++++++++++++++++++
  1086.  
  1087. >From hall_j@sat.mot.com (Joseph Hall)
  1088. Date: Wed, 1 Jun 1994 05:42:03 GMT
  1089. Organization: Motorola Inc., Satellite Communications
  1090.  
  1091. Seems it was apabla@hercules.cs.uregina.ca (jaime apablaza) who said:
  1092. >How much does Tmon Pro cost and where can I order it from?  I read in the 
  1093. >faq that Tmon has a rather steep learning curve so I was wondering is 
  1094. >that because the manual is rather cryptic.  If so are there third party 
  1095. >books on using Tmon?  Email preferred.
  1096.  
  1097. I'm not aware of any books on TMON (other than the fairly good documentation
  1098. that comes with it), but at least TMON seems to have a future now.  For a
  1099. while it looked as if it had been dropped on the floor and left for dead.
  1100.  
  1101. The current trend is STRONGLY toward Jasik's The Debugger, though.
  1102. Obviously there is no TMON for PowerPC at this time.
  1103.  
  1104. -- 
  1105. Joseph Nathan Hall | Joseph's Law of Interface Design: Never give your users
  1106. Software Architect | a choice between the easy way and the right way.
  1107. Gorca Systems Inc. |                 joseph@joebloe.maple-shade.nj.us (home)
  1108. (on assignment)    | (602) 732-2549 (work)  Joseph_Hall-SC052C@email.mot.com
  1109.  
  1110. +++++++++++++++++++++++++++
  1111.  
  1112. >From chewy@shell.portal.com (Paul F. Snively)
  1113. Date: 1 Jun 1994 14:26:07 GMT
  1114. Organization: tumbolia.com
  1115.  
  1116. In article <1994Jun01.031937.138522@sue.cc.uregina.ca>
  1117. apabla@hercules.cs.uregina.ca (jaime apablaza) writes:
  1118.  
  1119. > How much does Tmon Pro cost and where can I order it from?  I read in the 
  1120. > faq that Tmon has a rather steep learning curve so I was wondering is 
  1121. > that because the manual is rather cryptic.  If so are there third party 
  1122. > books on using Tmon?  Email preferred.
  1123.  
  1124. I would mail, but others might want to read this, too...
  1125.  
  1126. TMON Pro does have a significant learning curve, as does probably any
  1127. reasonably capable object-level debugger on the Mac.  The Mac is a
  1128. complex beast itself; to create a debugger that can interact with
  1129. heaps, resources, code, registers, etc. is difficult (says a guy who
  1130. used to work at ICOM Simulations, Inc.)
  1131.  
  1132. Having said that, here are my brief pointers for happiness in TMON Pro:
  1133.  
  1134. 1) Whenever you have a TMON Pro window open, note the little square box
  1135. in
  1136.    the upper right corner.  It looks like a zoom box, and in a sense,
  1137. it is:
  1138.    it will expand the window to show a variety of hidden (ugh) options
  1139. for
  1140.    use in that window.
  1141.  
  1142. 2) Learn--and I mean _really_ learn--TMON Pro's expression syntax. 
  1143. Easily
  1144.    90% of the cool things that you can do with TMON involve non-trivial
  1145. use
  1146.    of expressions.  For example, TMON Pro's "Stack Crawl" window is
  1147. just a
  1148.    Memory window with a moderately hairy expression used to crawl up
  1149. the
  1150.    stack.  There's an even hairier expression used to create a Memory
  1151. window
  1152.    that gives the names of all of the windows in the current world
  1153. (hairy to
  1154.    do because the titleHandle is at different offsets in b&w vs. color
  1155.    windows).  In particular, make sure that you fully understand
  1156. delayed vs.
  1157.    immediate evaluation.
  1158.  
  1159. 3) Remember that TMON Pro does, in fact, have a command line. 
  1160. Command-space
  1161.    will open it.  You may think, "but I hate command lines!"  So do I,
  1162. but
  1163.    it's the only way to do certain things in TMON Pro, e.g. type:
  1164.    "Step 4*LongPointer != F*LongPointer" (that is, step until the value
  1165. at
  1166.    LongPointer changes).
  1167.  
  1168. Like many old-hand TMON/TMON Pro users, I'm delighted to know that TMON
  1169. Pro for the PowerMac is forthcoming.
  1170.  
  1171. - ---------------------------------------------------------------------
  1172. Paul F. Snively          "Just because you're paranoid, it doesn't mean
  1173. chewy@shell.portal.com    that there's no one out to get you."
  1174.  
  1175. +++++++++++++++++++++++++++
  1176.  
  1177. >From dshayer@netcom.com (David Shayer)
  1178. Date: Wed, 1 Jun 1994 18:21:37 GMT
  1179. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  1180.  
  1181. : > How much does Tmon Pro cost and where can I order it from?  I read in the 
  1182. : > faq that Tmon has a rather steep learning curve so I was wondering is 
  1183. : > that because the manual is rather cryptic.  If so are there third party 
  1184. : > books on using Tmon?  Email preferred.
  1185.  
  1186. TMON is a great low level debugger, I don't think its any harder to use
  1187. than Macsbug, and it can certainly be easier to learn than Jasik.
  1188. It comes with 2 manuals, a reference manual and a tutorial.  I simply
  1189. read the tutorial all the way thru, and did all the examples.  It took
  1190. about a week of working every evening.  At the end, I was a TMON master.
  1191. (Well ok, I'm pretty competent with TMON :-)
  1192.  
  1193. There are no books I know of that explain how to use TMON.  However,
  1194. like all low level debuggers, if you don't know what's going on in
  1195. the Mac's guts, you won't know what you're looking at.  I highly
  1196. recommend Scott Knaster's book, How to Write Mac Software.  It actually
  1197. does have some examples in TMON, but in TMON 2.8, which is very old.
  1198.  
  1199. TMON 3.0 is available from APDA (800-282-2732) for $250.
  1200. It suppoessedly has a few quirks on the PowerPC.  Its been bought
  1201. by a new company, which is doing a PPC upgrade, so hopefully we'll
  1202. see a new version of TMON soon.
  1203.  
  1204. +------------------------------------------------------------------------+
  1205. |David Shayer                                  (415) 595-2523            |
  1206. |Sentient Software / Symantec                  shayer@applelink.apple.com|
  1207. |"They're not the best at what they do,        Applelink: SHAYER         |
  1208. | but they're the only ones who do what they do."                        |
  1209. +------------------------------------------------------------------------+
  1210.  
  1211.  
  1212. +++++++++++++++++++++++++++
  1213.  
  1214. >From roberts@insoftware.com (Robert Schwalbe)
  1215. Date: Sat, 11 Jun 1994 09:53:24 -0800
  1216. Organization: IN SOFTWARE
  1217.  
  1218. In article <dshayerCqqDo2.G1y@netcom.com>, dshayer@netcom.com (David
  1219. Shayer) wrote:
  1220.  
  1221. > TMON 3.0 is available from APDA (800-282-2732) for $250.
  1222. > It suppoessedly has a few quirks on the PowerPC.  Its been bought
  1223. > by a new company, which is doing a PPC upgrade, so hopefully we'll
  1224. > see a new version of TMON soon.
  1225.  
  1226. What is the name of this 'new' company, and how would we get in
  1227. contact with them?
  1228.  
  1229. ======================================================================
  1230. Robert Schwalbe                          INET:  roberts@insoftware.com
  1231. IN SOFTWARE                              Voice: 619.743.7502
  1232. 2403 Conway Drive                        Fax:   619.743.7503
  1233. Escondido, CA 92026    
  1234.  
  1235. +++++++++++++++++++++++++++
  1236.  
  1237. >From dshayer@netcom.com (David Shayer)
  1238. Date: Wed, 15 Jun 1994 05:03:14 GMT
  1239. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  1240.  
  1241. Robert Schwalbe (roberts@insoftware.com) wrote:
  1242. : In article <dshayerCqqDo2.G1y@netcom.com>, dshayer@netcom.com (David
  1243. : Shayer) wrote:
  1244.  
  1245. : > TMON 3.0 is available from APDA (800-282-2732) for $250.
  1246. : > It suppoessedly has a few quirks on the PowerPC.  Its been bought
  1247. : > by a new company, which is doing a PPC upgrade, so hopefully we'll
  1248. : > see a new version of TMON soon.
  1249.  
  1250. : What is the name of this 'new' company, and how would we get in
  1251. : contact with them?
  1252.  
  1253. The new "company" is really one guy, named Allan Foster.  You
  1254. can reach him at afcguru@aol.com.
  1255.  
  1256. David
  1257.  
  1258.  
  1259. ---------------------------
  1260.  
  1261. >From cconstan@epdiv1.env.gov.bc.ca (Carl B. Constantine)
  1262. Subject: Saving PICT files - Here's CODE!!
  1263. Date: Thu, 16 Jun 1994 07:10:55 -0700
  1264. Organization: Ministry of Environment, Lands & Parks
  1265.  
  1266. Here is some code that works for saving PICT files.  This code was
  1267. developed by a friend of mine, I'm not the author.
  1268.  
  1269. Here you go.
  1270.  
  1271. OK, I have working code for writing a PICT file from a mac Picture.
  1272. The trick is to write the fields of the Picture in the proper order.
  1273. Write 512 zeros, for conformity with old PICT files & MacDraw.
  1274. Then write the picture size, the picture rect, and finally the picture
  1275. opcodes.
  1276.  
  1277.  
  1278. PicHandle macPicture;
  1279. static Point SFPwhere = { 150, 150 };
  1280. static SFReply reply;
  1281.  
  1282. void MakePICTFile ()
  1283. {
  1284.     OSErr iErr;
  1285.     int iFileRef;
  1286.     CQDProcs myProcs;
  1287.     int longZero, i;
  1288.     long longCount = 1;
  1289.     Rect pFrame;
  1290.     PicHandle newPICTHand;
  1291.     short globalRef;
  1292.     Rect temp;
  1293.     int tempSize;
  1294.     
  1295.     SFPutFile ( SFPwhere, "\pSave PICT Plot as:","\pSaved PICT
  1296. Plot",NULL,&reply);
  1297.  
  1298.     if (reply.good)
  1299.     {
  1300.     
  1301.     
  1302.         PleaseWait ();                            /* change to watch cursor */
  1303.         ExerciseOffScreen ();                    /* draw pict in off-screen bitmap */
  1304.         
  1305.         iErr = Create ( reply.fName, reply.vRefNum, 'MKGW', 'PICT' );
  1306.                                                 /* create file */
  1307.         if (iErr != 0)
  1308.         {
  1309.             puts("Error - could not create file\n");
  1310.             return;
  1311.         }
  1312.         
  1313.         iErr = FSOpen ( reply.fName, reply.vRefNum, &globalRef );
  1314.                                                 /* open file */
  1315.  
  1316.         for ( i = 1; i<= 512; i++)                /* write 512 zeros for conformity to
  1317. standard */
  1318.             FSWrite (globalRef, &longCount, 0);
  1319.  
  1320.  
  1321.         longCount = 2;                            /* write picture size */
  1322.         tempSize = (*macPicture)->picSize;
  1323.         FSWrite (globalRef, &longCount, &tempSize);
  1324.         
  1325.         longCount = 8;                            /* write picture rect */
  1326.         temp = (*macPicture)->picFrame;
  1327.         FSWrite (globalRef, &longCount, &temp);
  1328.                                                 /* write picture */
  1329.         longCount = GetHandleSize ((Handle) macPicture);
  1330.         FSWrite (globalRef, &longCount, (Ptr) (*macPicture)+10);
  1331.                                                 /* picture starts 10 bytes from beginning address */
  1332.  
  1333.         FSClose (globalRef);
  1334.     }
  1335.  
  1336. }
  1337.  
  1338.  
  1339. Good luck!
  1340.  
  1341. -- 
  1342. =========================================================================
  1343. Carl B. Constantine                      B.C. Environment, Lands & Parks
  1344. End-User Support Analyst                 CCONSTAN@epdiv1.env.gov.bc.ca
  1345.    PGP Key available if you finger: CCONSTAN@EUSACBC.env.gov.bc.ca
  1346.  
  1347. ---------------------------
  1348.  
  1349. >From nhodulik@hypnos.norden1.com (Nick Hodulik)
  1350. Subject: Scroll Bars in DLOG?
  1351. Date: 6 Jun 1994 03:52:22 GMT
  1352. Organization: Norden 1 Communications
  1353.  
  1354. How does one make scroll bars work in a DLOG resource? I know it has something 
  1355. to do with the CNTL resource, but I can't figure it out. Please help me!
  1356.  
  1357. Nick
  1358.  
  1359. --
  1360. *-----------------------*------------------------------------*---------------*
  1361. |nhodulik@norden1.com   | "This train                        |   *------*    |
  1362. |Norden1 Communications |         is bound                   |    \ GO /     |
  1363. |Nick Hodulik           |              for glory..."         |    TITANS!    |
  1364. |Toledo, OH             |                    -Indigo Girls   |      \/       |      \/       |
  1365. *-----------------------*------------------------------------*---------------*
  1366.  
  1367. +++++++++++++++++++++++++++
  1368.  
  1369. >From Alex Kac <akac@delphi.com>
  1370. Date: Sat, 18 Jun 94 12:57:50 -0500
  1371. Organization: Delphi (info@delphi.com email, 800-695-4005 voice)
  1372.  
  1373. Nick Hodulik <nhodulik@hypnos.norden1.com> writes:
  1374.  
  1375. >How does one make scroll bars work in a DLOG resource? I know it has something 
  1376. >to do with the CNTL resource, but I can't figure it out. Please help me!
  1377. >
  1378. >Nick
  1379.  
  1380. Ok...here is some ol PASCAL source for you (easier to read)
  1381. FUNCTION NewDlogFilter (theDialog: DialogPtr;
  1382.        VAR theEvent: EventRecord;
  1383.        VAR itemhit: integer): boolean;
  1384.  
  1385. first, you need to use a ModalDialogFilter (if you're using a modaldialog)
  1386.  BEGIN
  1387.   setport(theDialog);
  1388.   IF (theEvent.what = update) AND (WindowPtr(theevent.message) <> theDialog) &
  1389. (WindowPeek(WindowPtr(theEvent.message))^.windowkind = dlog) THEN
  1390.    UpdtDialog(theDialog, (WindowPeek(WindowPtr(theEvent.message))^.updateRGN))
  1391.   ELSE IF (theEvent.what = activate) AND (DialogPtr(theEvent.message) <>
  1392. theDialog) THEN
  1393. {Deactivate any window behind....}
  1394.   ELSE
  1395.    CASE theEvent.what OF
  1396. ...do key stuff here....
  1397.     M_Down:
  1398.      BEGIN
  1399.       hitPt := theEVENT.where;
  1400.       GlobalToLocal(hitPt);
  1401.       Ahit := FindControl(hitPt, theDialog, hitControl);
  1402.       IF NOT (hitControl = NIL) THEN
  1403.        BEGIN
  1404.        dhit := FindDitem(theDialog, hitpt) + 1;
  1405.        GetDitem(theDialog, dhit, itemtype, itemhandle, itemrect);
  1406. {here I could have put a contrlAction in each of the 3 controls before I
  1407. started the Dialog, but thought this was the best way}
  1408.        CASE Ahit OF
  1409.        inButton:
  1410.        BEGIN
  1411.        CASE itemtype OF
  1412.        4..6:
  1413.        Ahit := TrackControl(hitControl, hitpt, NIL);
  1414.        7:
  1415.        Ahit := TrackControl(hitCOntrol, hitpt, Pointer(-1));    {since this is a
  1416. button, it can only be a PopUpMenu...}
  1417.        OTHERWISE
  1418.        ;
  1419.        END;
  1420.        CASE dhit OF
  1421. ...buttons and other stuff here....
  1422.        inUpButton:
  1423.        IF NOT (TrackControl(hitControl, hitpt, @UpButtonProc) = 0) THEN
  1424.        BEGIN
  1425.        NewDlogFilter := true;
  1426.        itemhit := dhit;
  1427.        END;
  1428.  
  1429.        inDownButton:
  1430.        IF NOT (TrackControl(hitControl, hitpt, @DownButtonProc) = 0) THEN
  1431.        BEGIN
  1432.        NewDlogFilter := true;
  1433.        itemhit := dhit;
  1434.        END;
  1435.  
  1436.        inThumb:
  1437.        IF NOT (TrackControl(hitControl, hitpt, NIL) = 0) THEN
  1438.        BEGIN
  1439.        ChangeBut(hitcontrol, theDialog);
  1440.        NewDlogFilter := true;
  1441.        itemhit := dhit;
  1442.        END;
  1443.  
  1444.        OTHERWISE
  1445.        ;
  1446.        END;
  1447.        END;
  1448.      END;        {end of MDown}
  1449.  
  1450.  
  1451.  
  1452. By!
  1453.  
  1454. ---------------------------
  1455.  
  1456. >From mburch@ksu.ksu.edu (Matt Burch)
  1457. Subject: Why should't you move baseAddrs?
  1458. Date: 15 Jun 1994 18:19:52 -0500
  1459. Organization: Kansas State University
  1460.  
  1461. Forgive me for sounding obtuse, but what excactly is wrong with
  1462. moving around baseAddrs? What's to prevent you from creating, say,
  1463. a GWorld or other offscreen pixmap with the same dimensions and
  1464. depth as the screen, and then setting the screen's baseAddr to
  1465. the baseAddr of the buffer when you want to draw a frame, instead
  1466. of blasting it into video memory? Am I missing something here?
  1467. Probably.
  1468.  
  1469. - Matt Burch
  1470.  
  1471.  
  1472. +++++++++++++++++++++++++++
  1473.  
  1474. >From kbell@cs.utexas.edu (Kevin Bell)
  1475. Date: Wed, 15 Jun 1994 23:30:38 -0600
  1476. Organization: The University of Texas at Austin, Austin, Texas
  1477.  
  1478. In article <2to2ao$o4k@matt.ksu.ksu.edu>, mburch@ksu.ksu.edu (Matt Burch)
  1479. wrote:
  1480.  
  1481. > Forgive me for sounding obtuse, but what excactly is wrong with
  1482. > moving around baseAddrs? What's to prevent you from creating, say,
  1483. > a GWorld or other offscreen pixmap with the same dimensions and
  1484. > depth as the screen, and then setting the screen's baseAddr to
  1485. > the baseAddr of the buffer when you want to draw a frame, instead
  1486. > of blasting it into video memory? Am I missing something here?
  1487. > Probably.
  1488. > - Matt Burch
  1489.  
  1490. The reason is that PixMaps are a QuickDraw software data structure, which
  1491. has little relation to the underlying video hardware. So if you change the
  1492. screen's baseAddr, QuickDraw commands will draw to the new port (if it
  1493. doesn't crash, I've never tried this), but the video hardware will continue
  1494. to fetch screen data from the old address.
  1495.  
  1496. -- 
  1497. Kevin Bell
  1498. kbell@cs.utexas.edu
  1499.  
  1500. ---------------------------
  1501.  
  1502. >From valentin+@pitt.edu (Shawn V. Hernan)
  1503. Subject: cntl-opt-esc
  1504. Date: 14 Jun 1994 00:19:12 GMT
  1505. Organization: The University of Pittsburgh
  1506.  
  1507. Greetings all, 
  1508.  
  1509.    Once again, I turn to the wisdom of the net...
  1510.  
  1511.    Is there any way to programatically intercept the cnt-alt-esc
  1512. keysequence? You know, the one that asks you if you really want to
  1513. force such and such to quit. I thought this was an AppleEvent, but
  1514. apparantly not....
  1515.  
  1516.  
  1517. Is this a FAQ? Do I have to resort to testing for that in my keyDown
  1518. events? 
  1519.  
  1520. Any help is deeply appreciated, 
  1521.  
  1522. Thanks, 
  1523. Shawn
  1524.  
  1525.  
  1526.  
  1527. Shawn Valentine Hernan       |Is the War on Drugs worth it?  
  1528. The University of Pittsburgh |Why does the government want your guns?  
  1529. valentin+@pitt.edu           |Does RICO ring a bell?   
  1530. 412-624-6425                 |Did you vote in the last election?
  1531.  
  1532. +++++++++++++++++++++++++++
  1533.  
  1534. >From Steve Maller <maller@genmagic.com>
  1535. Date: 14 Jun 1994 19:39:26 GMT
  1536. Organization: General Magic
  1537.  
  1538. In article <2tit20$59e@usenet.srv.cis.pitt.edu> Shawn V. Hernan,
  1539. valentin+@pitt.edu writes:
  1540. >   Is there any way to programatically intercept the cnt-alt-esc
  1541. >keysequence? You know, the one that asks you if you really want to
  1542. >force such and such to quit. I thought this was an AppleEvent, but
  1543. >apparantly not....
  1544. >
  1545. >Is this a FAQ? Do I have to resort to testing for that in my keyDown
  1546. >events? 
  1547.  
  1548. No dice. It's a pretty low level system patch (to PostEvent, I think)
  1549. so you'd have to patch PostEvent yourself and filter it out.
  1550. - ---------------------------------------------------------------
  1551. Steve Maller
  1552. Husband & Father
  1553. General Magic, Inc.
  1554.  
  1555. +++++++++++++++++++++++++++
  1556.  
  1557. >From mxmora@unix.sri.com (Matt Mora)
  1558. Date: 14 Jun 1994 15:33:11 -0700
  1559. Organization: SRI International, Menlo Park, CA
  1560.  
  1561. In article <2tl11e$lu0@gatekeep.genmagic.com> Steve Maller <maller@genmagic.com> writes:
  1562. >In article <2tit20$59e@usenet.srv.cis.pitt.edu> Shawn V. Hernan,
  1563. >valentin+@pitt.edu writes:
  1564. >>   Is there any way to programatically intercept the cnt-alt-esc
  1565. >>keysequence? You know, the one that asks you if you really want to
  1566. >>force such and such to quit. I thought this was an AppleEvent, but
  1567. >>apparantly not....
  1568. >>
  1569. >>Is this a FAQ? Do I have to resort to testing for that in my keyDown
  1570. >>events? 
  1571.  
  1572. Here you go from the up and coming UMPG volume II. 
  1573. (yes I'm actually working on it)
  1574.  
  1575.  
  1576.  
  1577.  
  1578. Subject: No Option Escape code
  1579. From: Manuel Veloso <veloso@husc9.harvard.edu>
  1580. Distribution: world
  1581.  
  1582. Someone a while back wanted code for killing off Force-Quit. Well, here's
  1583. one I found on CIS (I think) a few weeks ago. It works(!). It's in MPW
  1584. assembly, but 95% of it is the generic init install/patch. For anyone
  1585. doing
  1586. standalone systems (kiosks), well, you know...
  1587.  
  1588. ;    NoEscape.a
  1589.                 
  1590.                 include    'Traps.a'
  1591.  
  1592.                 machine    mc68000
  1593.                 case    obj
  1594.  
  1595. INITEntry        proc    export
  1596.                 
  1597.                 lea        EndPatch,a0
  1598.                 lea        StartPatch,a1
  1599.                 sub.l    a1,a0
  1600.                 move.l    a0,d0
  1601.                 move.l    a0,d3
  1602.                 _NewPtr sys
  1603.                 move.l    a0,d4
  1604.                 beq.s    NoPatch
  1605.                 
  1606.                 move.l    a0,a1
  1607.                 lea        StartPatch,a0
  1608.                 move.l    d3,d0
  1609.                 _BlockMove
  1610.  
  1611.                 move.w    #$a9c9,d0
  1612.                 _GetTrapAddress newTool
  1613.                 lea        RealSysError,a1
  1614.                 move.l    a0,(a1)
  1615.                 move.w    #$a9c9,d0
  1616.                 move.l    d4,a0
  1617.                 _SetTrapAddress newTool
  1618. NoPatch
  1619.                 rts
  1620.  
  1621. StartPatch        cmpi.w    #$4e22,d0
  1622.                 beq.s    NoThanks
  1623.                 move.l    RealSysError,-(sp)
  1624. NoThanks
  1625.                 rts
  1626.  
  1627. RealSysError    ds.l    1
  1628.  
  1629. EndPatch        equ        *
  1630.  
  1631.                 endp
  1632.  
  1633.                 end
  1634. -- 
  1635. ___________________________________________________________
  1636. Matthew Xavier Mora                       Matt_Mora@sri.com
  1637. SRI International                       mxmora@unix.sri.com
  1638. 333 Ravenswood Ave                    Menlo Park, CA. 94025
  1639.  
  1640. +++++++++++++++++++++++++++
  1641.  
  1642. >From Greg_Marriott@genmagic.com (Greg Marriott)
  1643. Date: Wed, 15 Jun 1994 06:21:07 -0800
  1644. Organization: General Magic, Inc.
  1645.  
  1646. Steve Maller <maller@genmagic.com> wrote:
  1647. > valentin+@pitt.edu writes:
  1648. > >   Is there any way to programatically intercept the cnt-alt-esc
  1649. > >keysequence?> 
  1650. > No dice. It's a pretty low level system patch (to PostEvent, I think)
  1651. > so you'd have to patch PostEvent yourself and filter it out.
  1652.  
  1653. Or you could patch SysError and intercept the dialog just before it comes
  1654. up, pretending the user hit cancel.
  1655.  
  1656. -- 
  1657. Greg Marriott
  1658. Just Some Guy
  1659. General Magic, Inc.
  1660.  
  1661. Disclaimer: My opinions are not necessarily the same as General Magic's.
  1662.             (can a company even HAVE an opinion?)
  1663.  
  1664. +++++++++++++++++++++++++++
  1665.  
  1666. >From Dave Falkenburg <falken@apple.com>
  1667. Date: Wed, 15 Jun 1994 16:14:42 GMT
  1668. Organization: Apple Computer, Inc.
  1669.  
  1670. In article <Greg_Marriott-150694062108@internet-macip-45.genmagic.com>
  1671. Greg Marriott, Greg_Marriott@genmagic.com writes:
  1672. >Steve Maller <maller@genmagic.com> wrote:
  1673. >> valentin+@pitt.edu writes:
  1674. >> >   Is there any way to programatically intercept the cnt-alt-esc
  1675. >> >keysequence?> 
  1676. >> No dice. It's a pretty low level system patch (to PostEvent, I think)
  1677. >> so you'd have to patch PostEvent yourself and filter it out.
  1678. >
  1679. >Or you could patch SysError and intercept the dialog just before it comes
  1680. >up, pretending the user hit cancel.
  1681.  
  1682. SysError(20002) is how force-quit happens.
  1683.  
  1684. As Greg said, just patch it to just RTS when the error code is 20002,
  1685. otherwise call through.
  1686.  
  1687. -Dave Falkenburg
  1688. -Apple Computer, Inc.
  1689.  
  1690. ---------------------------
  1691.  
  1692. >From fadushin@top.cis.syr.edu (Fred Dushin)
  1693. Subject: scroll bars in modal dialogs
  1694. Date: Thu, 16 Jun 1994 15:44:22 GMT
  1695. Organization: Syracuse University, CIS Dept.
  1696.  
  1697. >From what I gather from Inside Mac (old volume I and 
  1698. Toolbox Essentials), I need to handle mouseDown events
  1699. in scroll bars in modal dialogs with a filter proc.  I.e.,
  1700. ModalDialog does not return the part code for the control,
  1701. just the controlID.
  1702.  
  1703. Is that so?  If so, does someone have a sample filter procedure
  1704. that handles scroll bars I can scavange from?  Braaa.
  1705.  
  1706.  
  1707. Fred Dushin
  1708. Syracuse, NY
  1709.  
  1710. +++++++++++++++++++++++++++
  1711.  
  1712. >From Here@There (Someone)
  1713. Date: 17 Jun 1994 16:47:46 GMT
  1714. Organization: Large Fuzzy Room
  1715.  
  1716. In article <1994Jun16.154422.1710@newstand.syr.edu>,
  1717. fadushin@top.cis.syr.edu (Fred Dushin) wrote:
  1718. > Is that so?  If so, does someone have a sample filter procedure
  1719. > that handles scroll bars I can scavange from?  Braaa.
  1720. DialogBits 2.0.1 does this, it's on the DevCD and the ftp site.  Here's the
  1721. relevant code from the filter proc that tracks the scroll
  1722. control.............
  1723. // cut and paste into MPW to view right
  1724. // inside your filter proc
  1725. GetDItem(inputDialog, kScrollControlItem, &tempItem, &tempHandle,
  1726. &tempRect);
  1727.     if (PtInRect(mousePoint, &tempRect)) {
  1728.         /* We're in the scroll bar. */
  1729.         /* Now, what does that mean???? */
  1730.         /* Well, the Dialog Manager will automatically call FindControl and
  1731. TrackControl */
  1732.         /* and set the control value (in the case of scroll thumbs) */
  1733.         /* on controls added to your dialog, and in many cases that's all you're
  1734. going */
  1735.         /* to need. */
  1736.         /* But, ModalDialog does NOT pass back a part code, so if the userPerson
  1737. */
  1738.         /* clicked on the thumb or arrows of the scroll bar, you won't know,
  1739. you'll */
  1740.         /* just know that the  scroll bar was clicked in.*/
  1741.         /* That's not enough, so we'll to an initial check to see where the
  1742. control */
  1743.         /* was hit */
  1744.         thePart = FindControl(mousePoint, inputDialog, &returnedControl);
  1745.         /* if the hit was in an arrow or page area, we'll handle it ourselfs */
  1746.         if (thePart != inThumb) {
  1747.             TrackControl(returnedControl, mousePoint, (ProcPtr)DoScrollArrows);
  1748.             returnVal = true;
  1749.         }
  1750.         /* if it was in the thumb, we'll just fall through and let the Dialog
  1751. Manager */
  1752.         /* handle it for us */
  1753.     }
  1754.  
  1755.  
  1756.  
  1757.  
  1758. /* This little routine adjusts the scroll bar during TrackControl */
  1759. pascal void DoScrollArrows(ControlHandle theControl, short thePart)
  1760. {
  1761.     short currentVal = GetCtlValue(theControl);
  1762.     short offSet = 0;
  1763.     switch (thePart) {
  1764.         case inUpButton:
  1765.             offSet = -1;
  1766.             break;
  1767.         case inDownButton:
  1768.             offSet = 1;
  1769.             break;
  1770.         case inPageUp:
  1771.             offSet = -3;
  1772.             break;
  1773.         case inPageDown:
  1774.             offSet = 3;
  1775.             break;
  1776.             
  1777.     }
  1778.     /* set the control value to the new one, as long as it doesn't pass
  1779. limits */
  1780.     currentVal += offSet;
  1781.     if (currentVal < 1)
  1782.         currentVal = 1;
  1783.     if (currentVal > 10)
  1784.         currentVal = 10;
  1785.     SetCtlValue(theControl, currentVal);
  1786.     
  1787. } /* end DoScrollArrows */
  1788.  
  1789. <TR>
  1790. Somewhere, sometime
  1791.  
  1792. SPA FON
  1793.  
  1794. ---------------------------
  1795.  
  1796. End of C.S.M.P. Digest
  1797. **********************
  1798.  
  1799.  
  1800. ˇ